home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
ss
/
nohead10.zip
/
NOHEAD.DOC
next >
Wrap
Text File
|
1992-01-05
|
6KB
|
121 lines
NOHEAD.EXE v1.0
by James C. Hendee
The need for this program arose out of the usual hassle required
to edit columnar data files produced by such programs as Lotus,
Quattro Pro or Excel to accommodate easy import of the data into other
spreadsheets, database managers, graphics or statistics packages.
Although most spreadsheets will import worksheets produced by other
spreadsheets, others will not. They usually will, however, import
comma-delimited or SDF (system data or space-delimited format) files,
if the tops of the columns aren't cluttered with column headings and
descriptions (the header). dBase III+ and IV will import either
comma-delimited or space delimited data into a .DBF structure, but
again, any header info will make the first several records (equal to
the number of header lines) unusable.
NOHEAD will make two new files from your original data file: a
file with your header information, and a data file. The data file
will have either comma or space delimiters, or will be identical to
the original data file, minus the header. There should be no blank
entries in your original data file, or the resulting data file may be
unusable (try it and you'll see why). You must know the number of
lines in the header of your original data file for the program to work
correctly, and you must use unique names for all three file names. If
you use an input file name that doesn't exist, or if you input an
already existing file name that NOHEAD can't open (e.g., a read-only
file), you'll get an error message (all errors return an errorlevel of
1). The header can be of any length, which means you can also use
NOHEAD to split large ASCII files of any type into whatever sizes you
want (each line must end in a carriage return, however). You could
therefore split files produced by NOHEAD into other split files--use
the -t option described below if you don't want the data structure
changed.
Command line usage at the system prompt:
nohead -|/c|s|t input.dat header.txt data.txt 6
Switches are: -c or /c comma-delimited
-s or /s space-delimited
-t or /t original tabular form
Parameters: input.dat original data file
header.txt file name for the produced header file
data.txt file name for the produced data file
6 number of header lines in the input.txt
For example, if you had a spreadsheet file of oceanographic
nutrient values taken from the northern Gulf of Mexico, and you
printed the data to an ASCII file called NUTS.DAT, which had 5 lines
of text (header) at the top, you could use the following command line
to produce the header file HEAD.DOC and a comma-delimited file called
DATA.CMA:
NOHEAD /C NUTS.DAT HEAD.DOC DATA.CMA 5
The original data file (NUTS.DAT) would look like this:
Nutrient Data from the Northern Gulf of Mexico.
=======================================================================
Potent.
Depth Temp. Sal. O2 NH4 PO4 Si NO3 NO2
-----------------------------------------------------------------------
2 29.48 30.287 4.695 0.09 0.02 1.87 0.11 0
4 29.48 31.513 4.63 0.08 0.01 1.97 0.16 0
6 29.61 33.393 4.61 0.15 0.02 2.21 0.16 0
7 29.59 33.937 4.611 0.09 0.02 2.39 0.21 0
10 29.12 34.414 4.58 0.05 0.02 2.39 0.21 0
but your comma-delimited file (DATA.CMA) would look like this,
2,29.48,30.287,4.695,0.09,0.02,1.87,0.11,0
4,29.48,31.513,4.63,0.08,0.01,1.97,0.16,0
6,29.61,33.393,4.61,0.15,0.02,2.21,0.16,0
7,29.59,33.937,4.611,0.09,0.02,2.39,0.21,0
10,29.12,34.414,4.58,0.05,0.02,2.39,0.21,0
Your header file HEAD.DOC would look like this,
Nutrient Data from the Northern Gulf of Mexico.
=======================================================================
Potent.
Depth Temp. Sal. O2 NH4 PO4 Si NO3 NO2
-----------------------------------------------------------------------
If you chose to produce a space-delimited data file, it would look like
this,
2 29.48 30.287 4.695 0.09 0.02 1.87 0.11 0
4 29.48 31.513 4.63 0.08 0.01 1.97 0.16 0
6 29.61 33.393 4.61 0.15 0.02 2.21 0.16 0
7 29.59 33.937 4.611 0.09 0.02 2.39 0.21 0
10 29.12 34.414 4.58 0.05 0.02 2.39 0.21 0
Using the -t switch for an original tabular data form, you'd get this,
2 29.48 30.287 4.695 0.09 0.02 1.87 0.11 0
4 29.48 31.513 4.63 0.08 0.01 1.97 0.16 0
6 29.61 33.393 4.61 0.15 0.02 2.21 0.16 0
7 29.59 33.937 4.611 0.09 0.02 2.39 0.21 0
10 29.12 34.414 4.58 0.05 0.02 2.39 0.21 0
You may distribute this program, provided you do not charge for
it, and all files remain intact. Following is a CRC check for
NOHEAD.EXE v1.0:
FILE CRC LENGTH DATE
==== === ====== ====
NOHEAD.EXE 34129 16865 1/5/92
If you'd like this program for work in another environment, or if
you have comments, suggestions or questions, you may contact me by
modem on COASTAL RBBS at 305 361-4524 (300 to 19,200 baud, 8/N/1), or,
write to me at:
Jim Hendee
1301 SE 5 Avenue
Pompano Beach, FL 33060